SunOS pathconf on hsfs filesystem crashes machine

Patrick Rabau (rabau@ultra.acs.ohio-state.edu)
Sat, 3 Dec 1994 21:40:58 -0500

Has anyone noticed the same problem on SunOS?

Doing a pathconf(_PC_PIPE_BUF) on a cdrom file system mounted with type
hsfs crashes SunOS 4.1.3_U1, both on a sun4c and a sun4m machine.  This
is run as an ordinary user!!

[Both these machines had the patch below applied, but it's probably an
unrelated problem.
Patch-ID# 101833-02
Synopsis: SunOS 4.1.3_U1: 4.x systems can't read symlinks in hsfs filesystems]

For details: compile the following into a file named `crash'.

#include <unistd.h>
#include <errno.h>
main(argc, argv) 
int argc;
char **argv;
{
	long val;
	if ((val = pathconf(argv[1], _PC_PIPE_BUF)) == -1) {
		    printf("errno: %d\n", errno);
		    perror("pathconf");
		    exit(1);
	}
	printf("PIPE_BUF = %d\n", val);
}

Now mount the cdrom:

# mount -t hsfs -o ro /dev/sr0 /mnt

As yourself:

> crash /mnt

Any fixes?

--Patrick Rabau